/*
 * InputOutputManager.h
 *
 *  Created on: 2012-04-22
 *      Author: mm
 *
 *      This class provides methods for file I/O. It is the base class
 *      for the user interface.
 *
 *      Implements a singleton pattern.
 */

#ifndef INPUTOUTPUTMANAGER_H_
#define INPUTOUTPUTMANAGER_H_

#include <string>
#include <fstream>
#include <iostream>
#include <cstdlib>
#include "InputParser.h"
#include "TestGenerator.h"

class InputOutputManager
{
public:
	/**
	 *  Singleton class - new instances of it cannot be created
	 *  and the only instance can be obtained via the getInstance() method.
	 */
	static InputOutputManager* getInstance()
	{
		if(!instance_)
			instance_ = new InputOutputManager();
		return instance_;
	}

	/**
	 *	Reads input file.
	 */
	void readFile(const std::string& filename);

	/**
	 * Writes results to specified filename.
	 */
	void writeFile(const std::string& filename);


private:
	InputOutputManager() {}
	InputOutputManager(const InputOutputManager&) {}
	virtual ~InputOutputManager() {}

	static InputOutputManager* instance_;
};
#endif /* INPUTOUTPUTMANAGER_H_ */
